Integrand size = 26, antiderivative size = 111 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \]
[Out]
Time = 0.28 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3642, 21, 3635, 3561, 212, 3680, 65, 214} \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \]
[In]
[Out]
Rule 21
Rule 65
Rule 212
Rule 214
Rule 3561
Rule 3635
Rule 3642
Rule 3680
Rubi steps \begin{align*} \text {integral}& = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {\int \cot (c+d x) \left (\frac {i a}{2}-\frac {1}{2} a \tan (c+d x)\right ) \sqrt {a+i a \tan (c+d x)} \, dx}{a} \\ & = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {i \int \cot (c+d x) (a+i a \tan (c+d x))^{3/2} \, dx}{2 a} \\ & = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {i \int \cot (c+d x) (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)} \, dx}{2 a}-\int \sqrt {a+i a \tan (c+d x)} \, dx \\ & = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {(i a) \text {Subst}\left (\int \frac {1}{x \sqrt {a+i a x}} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {(2 i a) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = \frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {\text {Subst}\left (\int \frac {1}{i-\frac {i x^2}{a}} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = -\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \\ \end{align*}
Time = 0.40 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.95 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {-i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )+i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )-\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 579 vs. \(2 (89 ) = 178\).
Time = 7.93 (sec) , antiderivative size = 580, normalized size of antiderivative = 5.23
method | result | size |
default | \(-\frac {\sqrt {-\frac {a \left (2 i \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}+1\right )}{\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\, \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\, \left (-3 i \sin \left (d x +c \right ) {\left (\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1\right )}^{\frac {5}{2}}+3 i \csc \left (d x +c \right ) {\left (\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1\right )}^{\frac {3}{2}} \left (1-\cos \left (d x +c \right )\right )^{2}+6 i \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{\sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\right ) \left (1-\cos \left (d x +c \right )\right )-3 i \csc \left (d x +c \right ) \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\, \left (1-\cos \left (d x +c \right )\right )^{2}+\left (1-\cos \left (d x +c \right )\right ) {\left (\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1\right )}^{\frac {3}{2}}-\left (\csc ^{2}\left (d x +c \right )\right ) \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\, \left (1-\cos \left (d x +c \right )\right )^{3}-3 i \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+\sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\right ) \left (1-\cos \left (d x +c \right )\right )-6 \sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}{2}\right ) \left (1-\cos \left (d x +c \right )\right )+4 \left (1-\cos \left (d x +c \right )\right ) \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}-3 \arctan \left (\frac {1}{\sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\right ) \left (1-\cos \left (d x +c \right )\right )\right )}{6 d \left (-\csc \left (d x +c \right )+\cot \left (d x +c \right )+i\right ) \left (1-\cos \left (d x +c \right )\right )}\) | \(580\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 476 vs. \(2 (84) = 168\).
Time = 0.25 (sec) , antiderivative size = 476, normalized size of antiderivative = 4.29 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {2 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (4 \, {\left ({\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - 2 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (4 \, {\left ({\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) + {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (16 \, {\left (3 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, \sqrt {2} {\left (i \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + i \, a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) - {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (16 \, {\left (3 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, \sqrt {2} {\left (-i \, a d e^{\left (3 i \, d x + 3 i \, c\right )} - i \, a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) + 4 \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (i \, e^{\left (3 i \, d x + 3 i \, c\right )} + i \, e^{\left (i \, d x + i \, c\right )}\right )}}{4 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \]
[In]
[Out]
\[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \cot ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.21 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \, a {\left (\frac {\sqrt {2} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}{\sqrt {a}} - \frac {\log \left (\frac {\sqrt {i \, a \tan \left (d x + c\right ) + a} - \sqrt {a}}{\sqrt {i \, a \tan \left (d x + c\right ) + a} + \sqrt {a}}\right )}{\sqrt {a}} - \frac {2 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a}}{a \tan \left (d x + c\right )}\right )}}{2 \, d} \]
[In]
[Out]
\[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int { \sqrt {i \, a \tan \left (d x + c\right ) + a} \cot \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Time = 4.60 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.87 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{\sqrt {-a}}\right )\,1{}\mathrm {i}}{d}-\frac {\mathrm {cot}\left (c+d\,x\right )\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}+\frac {\sqrt {2}\,\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{d} \]
[In]
[Out]